﻿using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Infrastructure.Middlewares
{
    public static class LimitMiddlewareExtensions
    {
        public static IApplicationBuilder UseLimitMiddleware(this IApplicationBuilder builder, IHostEnvironment webHostEnvironment)
        {
            return builder.UseMiddleware<LimitMiddleware>();
        }
    }
    public class LimitMiddleware
    {
        private readonly RequestDelegate _next;

        public LimitMiddleware(RequestDelegate next)
        {
            _next = next;
        }

        public Task Invoke(HttpContext httpContext)
        {
            return _next(httpContext);
        }
    }
}
